package com.mengsenlin.controller;

import com.mengsenlin.entity.Result;
import com.mengsenlin.entity.ShoppingCart;
import com.mengsenlin.service.CartService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.servlet.http.HttpSession;

/**
 * Created by Administrator on 2017/8/17.
 */
@Controller
public class CartController {
    @Autowired
    CartService cartService;

    @RequestMapping(value = "/home/addToCart",method = RequestMethod.POST)
    @ResponseBody
    public Result<ShoppingCart> addToCart(long goodsId, long speId, HttpSession session){
        return cartService.addToCart(goodsId, speId, session);
    }


}
